package com.ruoyi.teacher.api.factory;

import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.common.core.web.page.TableDataInfo;
import com.ruoyi.student.domain.TClass;
import com.ruoyi.teacher.api.TeacherService;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

/*
 *
 * @Author: awsister
 * @Date: 2022/12/27 0027 16:10
 */
@Component
public class TeacherServiceFallbackFactory implements FallbackFactory<TeacherService> {
    @Override
    public TeacherService create(Throwable cause) {
        return new TeacherService() {
            @Override
            public AjaxResult findTeacherByName(String name) {
                return AjaxResult.error(-1, "网络延迟，请稍后再试");
            }
        };
    }
}
